<!DOCTYPE html">
<html>
<head>
<title>Pick-up Master</title>

<link href="styles.css" type="text/css" rel="stylesheet"/>
</head>
    
<body>
<script type="text/javascript">

function validateEmail(cc){
	if (cc.value == '')
        return true;
    var rex = /(^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$)|(^[Dd]rop)/;
    if (rex.test(cc.value)) {
        return true;
    }
    alert("Please enter a valid email address \n");
    cc.focus();
    cc.select();
    return false;

}
</script>	
	
    
<p>Please enter the following information for registration:</p>

<form action="" method="post">
	Name: <input type="text" name="new_name" /><br />
	Username: <input type="text" name="new_username" /><br />
	Password: <input type="password" name="new_password1" /> <br />
	Re-enter Password: <input type="password" name="new_password2" /> <br />
    Email: <input type="text" name="new_email" onblur="javascript:validateEmail(this);"/> <br/>
    
    Skill Level (1-10): <select name="new_skill">
	<option value="1">1</option>
	<option value="2">2</option>
	<option value="3">3</option>
	<option value="4">4</option>
	<option value="5">5</option>
	<option value="6">6</option>
	<option value="7">7</option>
	<option value="8">8</option>
	<option value="9">9</option>
	<option value="10">10</option>
	</select>  <br/>
	
	Location: <select name="new_location">
	<option value="1">Toronto</option>
	<option value="2">Scarborough</option>
	<option value="3">Missisauga</option>
	<option value="4">Barrie</option>
	<option value="5">Oakville</option>
	<option value="6">Oshawa</option>
	<option value="7">Whitby</option>
	<option value="8">North York</option>
	<option value="9">Markham</option>
	<option value="11">Vaughn</option>
	<option value="12">Waterloo</option>
	<option value="13">Geulph</option>
	<option value="14">London</option>
	<option value="15">Hamilton</option>
	<option value="16">Richmond Hill</option>
	<option value="17">Etobicoke</option>
	<option value="18">Belleville</option>
	<option value="19">Newmarket</option>
	<option value="20">Aurora</option>
	<option value="21">Burlinton</option>
	<option value="22">St. Catherines</option>
	<option value="23">Kitchener</option>
	</select>  <br/>
	
	Sport Interested: <br/> <textarea cols="20" rows="4" name="newsports"></textarea>  <br/>
	
	<input type="submit" value="Submit" /> 
</form>

<p> Go back to Login <a href="loginpage.php">Login</a> </p>

<?php include("db.php");

if ($_POST['new_name']) {
register($_POST['new_name'],$_POST['new_username'],$_POST['new_password1'], $_POST['new_password2'], $_POST['new_email'],$_POST['new_location'],$_POST['new_skill'],$_POST['newsports']);
}

?>

</body>
</html>
